<!-- 正文开始 -->
<form id="admin_Edit_Form"   class="layui-form layui-row model-form no-padding">
    <div class="model-form-body" onscroll="layui.admin.hideFixedEl();">
        <input name="id" type="hidden" value="{$info.id}"/>
        <div class="layui-col-md6">
            <div class="layui-form-item">
                <label class="layui-form-label layui-form-required">用户名</label>
                <div class="layui-input-block">
                    <input name="username" value="{$info.username}" class="layui-input" lay-verType="tips" lay-verify="required" required/>
                </div>
            </div>
        </div>
        <div class="layui-col-md6">
            <div class="layui-form-item">
                <label class="layui-form-label layui-form-required">密码</label>
                <div class="layui-input-block">
                    <input type="password" name="password" value="{$info.password}" class="layui-input" lay-verType="tips" lay-verify="required"
                           required/>
                </div>
            </div>
        </div>
        <div class="layui-col-md6">
            <div class="layui-form-item">
                <label class="layui-form-label layui-form-required">手机号</label>
                <div class="layui-input-block">
                    <input name="phone" value="{$info.phone}" class="layui-input" lay-verType="tips" lay-verify="required" required/>
                </div>
            </div>
        </div>

        <div class="layui-col-md6">
            <div class="layui-form-item">
                <label class="layui-form-label layui-form-required">状态</label>
                <div class="layui-input-block">
                    <input name="status" type="radio" value="1" title="正常" checked/>
                    <input name="status" type="radio" value="0" title="禁用"/>
                </div>
            </div>
        </div>

         <div class="layui-form-item text-right">
            <button class="layui-btn layui-btn-primary" type="button" ew-event="closeDialog">取消</button>
            <button id="AdminSub_Loading"  class="layui-btn" lay-filter="AdminSub" lay-submit>保存</button>
        </div>
    </div>
</form>

<!-- js部分 -->
<script>
    layui.use(['layer', 'form', 'jquery','admin','table'], function () {
        var $ = layui.jquery;
        var layer = layui.layer;
        var form = layui.form;
        var admin = layui.admin;
        var table = layui.table;
        form.render()
        form.on('submit(AdminSub)', function (data) {
            admin.btnLoading('#AdminSub');
            $.get("{:url('save')}", data.field, function (res) {
                if (res.code === 1) {
                    layer.msg(res.msg, {icon: 1});
                    admin.btnLoading('#AdminSub',false);
                    table.reload('adminTable_id', {page: {curr: 1}});
                    admin.closeDialog('#admin_Edit_Form');
                }else{
                    layer.msg(res.msg, {icon: 2});
                    admin.btnLoading('#AdminSub',false);
                }
            }, 'json');
            return false;
        });
    });
</script>
